﻿@inject Sykj.IServices.IConfigsys _configsys
<!DOCTYPE html>
<html>
<head>
    <title>@_configsys.GetValue(Sykj.Components.Constant.WEBSITE)系统</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="~/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="~/layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" href="~/layuiadmin/style/login.css" media="all">
</head>
<body>
    <div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login" style="display: none;">
        <div class="layadmin-user-login-main">
            <div class="layadmin-user-login-box layadmin-user-login-header">
                <h2>管理后台</h2>
                <p>@_configsys.GetValue(Sykj.Components.Constant.WEBSITE)系统</p>
            </div>
            <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
                <div class="layui-form-item">
                    <label class="layadmin-user-login-icon layui-icon layui-icon-username" for="LAY-user-login-username"></label>
                    <input type="text" name="username" id="LAY-user-login-username" lay-verify="required" lay-verType="tips" placeholder="用户名" class="layui-input">
                </div>
                <div class="layui-form-item">
                    <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="LAY-user-login-password"></label>
                    <input type="password" name="password" id="LAY-user-login-password" lay-verify="required" lay-verType="tips" placeholder="密码" class="layui-input">
                </div>
                <div class="layui-form-item">
                    <button class="layui-btn layui-btn-fluid" lay-submit lay-filter="LAY-user-login-submit">登 录</button>
                </div>
                <div class="layui-trans layadmin-user-login-footer">

                    <p>© @DateTime.Now.Year <a href="http://www.sykjwh.cn/" target="_blank">云南尚雅科技文化有限公司</a></p>
                </div>

            </div>
        </div>
    </div>
    <script type="text/javascript" src="~/layuiadmin/layui/layui.js"></script>
    <script type="text/javascript">
        layui.use(['form', 'layer'], function () {
            var $ = layui.$, form = layui.form, layer = layui.layer;
            //提交
            form.on('submit(LAY-user-login-submit)', function (obj) {
                var _that = $(this);
                _that.text("登录中...").attr("disabled", "disabled").addClass("layui-disabled");
                //请求登入接口
                $.ajax({
                    url: '@Url.Action("login", "login", new { area = Constant.AREAMANAGER })',
                    type:'POST',
                    data: obj.field,
                    success: function (res) {
                        if (res.success === true) {
                            //登入成功的提示与跳转
                            layer.msg(res.msg, {icon: 1,time: 1000}, function () {
                                location.href = '@Url.Action("index", "home", new { area = Constant.AREAMANAGER })';
                            });
                        }
                        else {
                            layer.msg(res.msg, { icon: 2, time: 1000 });
                            _that.text("登 录").removeAttr("disabled").removeClass("layui-disabled");
                        }
                    }
                });
            });
        });
    </script>
</body>
</html>
<div style="display:none;">
    <script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? "https://" : "http://"); document.write(unescape("%3Cspan id='cnzz_stat_icon_1277687301'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s96.cnzz.com/z_stat.php%3Fid%3D1277687301%26show%3Dpic' type='text/javascript'%3E%3C/script%3E"));</script>
</div>
